import java.util.Arrays;
import java.util.Scanner;

/**
 * @Author: YCKOKO
 * @Date: 2023-05-09
 * @Time:16:35
 * @Description:
 */
public class demo1 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] nums = new int[n*3];
        for (int i = 0; i < nums.length; i++) {
            nums[i] = scan.nextInt();
        }
        Arrays.sort(nums);

        int left = 0;
        int right = nums.length - 1;
        //int sum = 0;  //错误写法，sum超出int取值范围
        long sum = 0;   //正确写法，sum不会超出long取值范围

        while(left < right){
            right -= 1;
            sum += nums[right];
            right -= 1;
            left += 1;
        }

        System.out.println(sum);
    }
}
